﻿using System.Collections.Generic;

namespace Game
{
    public class SceneConfigEntity : ConfigEntity
    {
        private Dictionary<string, SceneConfigData> _sceneName2dataDict = new Dictionary<string, SceneConfigData>();
        
        public SceneConfigEntity() : base("Assets/Game/Assets/Config/Scene/scenes.json")
        {
        }

        public SceneConfigData GetData(string sceneName)
        {
            return _sceneName2dataDict[sceneName];
        }
        
        protected override void InitConfig()
        {
            foreach (string sceneName in _configJsonObject.Keys)
            {
                SceneConfigData configData = new SceneConfigData(sceneName, _configJsonObject[sceneName]);
                _sceneName2dataDict.Add(sceneName, configData);
            }
        }
    }
}